<?php 
include_once("$config[webroot]/includes/page_utf_class.php");
//删除活动
if($_GET['act']=='del' && $_GET['delid'])
{
	$sql="update ".SHAREDATA."  set status=-1 where id='$_GET[delid]'";
	$db->query($sql);
	unset($_GET['act']);
	unset($_GET['delid']);
	$getstr=implode('&',convert($_GET));
	msg("?m=share_data&s=share_data_list.php&$getstr");
}
if($_POST['act']=='op')
{
	if(is_array($_POST['chk']))
	{
		$id=implode(",",$_POST['chk']);
		$sql="update ".SHAREDATA."  set status=-1 where id in({$id})";
		$db->query($sql);
	}
	msg("?m=share_data&s=share_data_list.php");
}

$where = "";
if(($_GET['statu']!="") && ($_GET['statu']>=0)){
	$where .=" and status='$_GET[statu]'";
}else{
	$where .=" and status>-1";
}
$sql = "select * from ".SHAREDATA." where 1 {$where}";
$page = new Page;
$page->listRows=20;
//分页
if (!$page->__get('totalRows'))
{
	$db->query($sql);
	$page->totalRows = $db->num_rows();
}
$sql .= "  limit ".$page->firstRow.",".$page->listRows;
$db->query($sql);
$de['list']=$db->getRows();
$de['page']=$page->prompt();
$condTemp = $_GET;
unset($condTemp['m']);
unset($condTemp['s']);
$cond = "";
if(count($condTemp)){
	$cond = "&".http_build_query($condTemp);
}
$tpl->assign("cond",$cond);
$tpl->assign('de',$de);
$tpl->assign("config",$config);
$tpl->display("share_data_list.htm");
?>